.set-text-color (@color) when (lightness(@color) >= 70) { 
    color: #333;
}
.set-text-color (@color) when (lightness(@color) < 70) { 
    color: #fff;
}

.setColor(@color) {
    .bg-@{color} { 
      background-color: ~"@{@{color}}" !important;
    }
    .border-@{color} { 
      border-color: ~"@{@{color}}" !important;
    }
    .btn-@{color} { 
      background-color: ~"@{@{color}}";
      border-color: ~"@{@{color}}";
      color:#fff;
    }
    .btn-@{color}:hover, .btn-@{color}:focus, .btn-@{color}.active { 
      background-color: desaturate(darken(@@color,10%),10%) !important;
      border-color: desaturate(darken(@@color,10%),10%) !important;
      color:#fff;
    }
    .btn-bordered.btn-@{color}{
      color: ~"@{@{color}}";
    }
    .text-@{color} { 
      color: ~"@{@{color}}" !important;
    }
    .alert-@{color} { 
      color: desaturate(darken(@@color,5%),10%) !important;
    }
    .panel-@{color}{
      border-color: desaturate(darken(@@color,5%),10%) !important;
    }
    .panel-@{color} .panel-heading{ 
      background-color: ~"@{@{color}}" !important;
      border-color: desaturate(darken(@@color,5%),10%) !important;
      border-radius: 0px;
    }
    .panel-@{color} .panel-heading a,.panel-@{color} .panel-title{
      .set-text-color(@@color);
    }
}

.rounded-corners (@radius: 2px) {
  -webkit-border-radius: @radius;
  -moz-border-radius: @radius;
  -ms-border-radius: @radius;
  -o-border-radius: @radius;
  border-radius: @radius;
}

.backgroundCover(){
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

.opacity(@opacity) {
  opacity: @opacity;
  @opacity-ie: @opacity * 100;
  filter: ~"alpha(opacity=@{opacity-ie})"; // IE8
}

.rotate(@degrees) {
  -webkit-transform: rotate(@degrees);
     -moz-transform: rotate(@degrees);
      -ms-transform: rotate(@degrees);
       -o-transform: rotate(@degrees);
          transform: rotate(@degrees);
}

.scale(@ratio) {
  -webkit-transform: scale(@ratio);
     -moz-transform: scale(@ratio);
      -ms-transform: scale(@ratio);
       -o-transform: scale(@ratio);
          transform: scale(@ratio);
}

.translate(@x, @y) {
  -webkit-transform: translate(@x, @y);
     -moz-transform: translate(@x, @y);
      -ms-transform: translate(@x, @y);
       -o-transform: translate(@x, @y);
          transform: translate(@x, @y);
}

.skew(@x, @y) {
  -webkit-transform: skew(@x, @y);
     -moz-transform: skew(@x, @y);
      -ms-transform: skewX(@x) skewY(@y);
       -o-transform: skew(@x, @y);
          transform: skew(@x, @y);
  -webkit-backface-visibility: hidden;
}

.translate3d(@x, @y, @z) {
  -webkit-transform: translate3d(@x, @y, @z);
     -moz-transform: translate3d(@x, @y, @z);
       -o-transform: translate3d(@x, @y, @z);
          transform: translate3d(@x, @y, @z);
}

.placeholder(@color: @input-color-placeholder) {
  &:-moz-placeholder            { color: @color; } // Firefox 4-18
  &::-moz-placeholder           { color: @color; } // Firefox 19+
  &:-ms-input-placeholder       { color: @color; } // Internet Explorer 10+
  &::-webkit-input-placeholder  { color: @color; } // Safari and Chrome
}

.transition (@transition: all .25s ease-in-out) {
  -webkit-transition: @transition;
  -moz-transition: @transition;
  -ms-transition: @transition;
  -o-transition: @transition;
  transition: @transition;
}

.box-shadow (@boxShadow : 0px 1px 3px rgba(0,0,0,.3)) {
  -webkit-box-shadow: @boxShadow;
  -moz-box-shadow: @boxShadow;
  box-shadow: @boxShadow;
}

.background-opacity(@color, @opacity) {
    @rgba-color: rgba(red(@color), green(@color), blue(@color), @opacity);

    background-color: @rgba-color;

    // Hack for IE8:
    background: none\9; // Only IE8
    filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d')", argb(@rgba-color),argb(@rgba-color))); // IE9 and down
    // Problem: Filter gets applied twice in IE9.
    // Solution:
    &:not([dummy]) {
      filter: progid:DXImageTransform.Microsoft.gradient(enabled='false'); // Only IE9
    }
}


.bk-gradient(@deg: 0deg, @firstColor, @secColor ) {
    background: @firstColor;
    /* Old browsers */
    background: -moz-linear-gradient(@deg, @firstColor 0%, @secColor 100%);
    /* FF3.6+ */
    background: -webkit-gradient(linear, left top, right bottom, color-stop(0%, @firstColor), color-stop(100%, @secColor));
    /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(@deg, @firstColor 0%, @secColor 100%);
    /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(@deg, @firstColor 0%, @secColor 100%);
    /* Opera 11.10+ */
    background: -ms-linear-gradient(@deg, @firstColor 0%, @secColor 100%);
    /* IE10+ */
    background: linear-gradient(@deg, @firstColor 0%, @secColor 100%);
    /* W3C */
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr= @firstColor , endColorstr= @secColor , GradientType=1);
    /* IE6-9 fallback on horizontal gradient */
}